using Gateway.Common.Extensions;
using Gateway.Domain.EFCore.Configuration;
using Gateway.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace Gateway.Domain.Configuration;

public class SystemExtensionSettingConfiguration : AggregateRootEntityConfiguration<SystemExtensionSetting>
{
    public override void Configure(EntityTypeBuilder<SystemExtensionSetting> builder)
    {
        builder.ToTable(t => t.HasComment("系统设置中的扩展配置表"));
        base.Configure(builder);
        builder.Property(x => x.Key).IsRequired().HasMaxLength(500).HasComment("Key");
        builder.Property(x => x.Value).IsRequired().HasMaxLength(500).HasComment("Value");

        builder.Property(x => x.Category).HasMaxLength(500).HasComment("Category");
        builder.Property(x => x.Title).HasMaxLength(500).HasComment("Title");
    }
}